package com.ls.utils.weight;

/**
 * Created by xc on 2019/11/23
 * 带权重的随机选择
 */

public class WeightTest {
    public static void main(String[] args) {
        Pair[] options = new Pair[]{new Pair("first", 13.3), new Pair("second", 3.3), new Pair("third", 3.3)};
        WeightRandom rnd = new WeightRandom(options);
        for (int i = 0; i < 10; i++) {
            System.out.print(rnd.nextItem() + " ");
        }
    }

}
